package cn.school.demo.ui.party_history_answer

import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import cn.school.demo.MyApplication
import cn.school.demo.pojo.Test
import cn.school.demo.repository.AnswerRepository


class ProfessionalViewModel : ViewModel() {

    private var _professions: LiveData<MutableList<String>> =
        AnswerRepository().getProfessionalList()
    val professions: LiveData<MutableList<String>>
        get() = _professions

    private lateinit var _testList: LiveData<MutableList<Test>>
    val testList: LiveData<MutableList<Test>>
        get() = _testList

    fun getTestList(topicName: String,f: FragmentManager) {
        _testList = AnswerRepository().getPartyHistoryAnswer(
            MyApplication.user!!.sfNumber,
            "专项党史答题",
            topicName,
            f
        )
    }


}